package com.hudongwx.sadpw.fragment;


import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.hudongwx.sadpw.R;
import com.hudongwx.sadpw.activity.LoginActivity;
import com.hudongwx.sadpw.activity.MoreActivity;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.ViewInject;
import org.xutils.x;

/**
 * A simple {@link Fragment} subclass.
 */
@ContentView(R.layout.fragment_my)
public class MyFragment extends Fragment {
    private View view;
    @ViewInject(R.id.my_ll)
    LinearLayout linearLayout;
    @ViewInject(R.id.my_ll_1)
    LinearLayout linearLayout1;
    @ViewInject(R.id.my_ll_2)
    LinearLayout linearLayout2;
    @ViewInject(R.id.my_ll_3)
    LinearLayout linearLayout3;
    @ViewInject(R.id.more)
    LinearLayout linearLayout4;
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        if (null==view){
            view= x.view().inject(this,inflater,container);
            linearLayout4.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Intent intent=new Intent(getContext(), MoreActivity.class);
                    getActivity().startActivity(intent);
                }
            });
            linearLayout.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Intent intent=new Intent(getContext(), LoginActivity.class);
                    getActivity().startActivity(intent);
                }
            });
            linearLayout1.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Intent intent=new Intent(getContext(), LoginActivity.class);
                    getActivity().startActivity(intent);
                }
            });
            linearLayout2.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Intent intent=new Intent(getContext(), LoginActivity.class);
                    getActivity().startActivity(intent);
                }
            });
            linearLayout3.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Intent intent=new Intent(getContext(), LoginActivity.class);
                    getActivity().startActivity(intent);
                }
            });
        }
        return view;
    }
    public void tiaozhuan(LinearLayout linearLayout){
        linearLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(getContext(), LoginActivity.class);
                getActivity().startActivity(intent);
            }
        });

    }
}
